<?php
	class indexControl extends Control{
	//主页显示；	
		function index(){
			//本季热销分配
			$result = readtable(4,6);
			$this -> assign("hotsell",$result);
			//最新线路分配
			$result = readtable(5,6);
			$this -> assign("newline",$result);
			//特价线路
			$result = readtable(6,6);
			$this -> assign("lowerprice",$result);
			//本周预定排行；
			$order = readnotes("order","total_ticket","desc",10);
			$this->assign("order",$order);
			//最新线路排行排行；
			$new_line = readnotes("totalticket","s_total","desc",10);
			$this -> assign("new_line",$new_line);
			//显示团购部分部分；
			$db = M("tuan");
			$rs = $db -> order("recordtime desc") -> limit(1) -> all();
			$rs = floats($rs);
			$this->assign("rs",$rs);
			//最新资讯；
			$db = M("instr");
			$re = $db -> order("inid desc") -> limit(8) -> all();
			$this -> assign("re",$re);
			//轮播；
			$this -> assign("res",lunbo(1));
			$this->display();
		}
	//港澳游
		function HK(){
			//迪士尼专线；
			$rows = readpicbase("pic_base","catid=10","picid","desc",4);	
			$this -> assign("rows",$rows);
			//港澳旅游；
			$this -> assign("row",readpicbase("pic_base","catid=11","picid","desc",4));
			//香港旅游
			$this -> assign("res",readpicbase("pic_base","catid=12","picid","desc",4));
			//澳门旅游
			$this -> assign("result",readpicbase("pic_base","catid=13","picid","desc",4));
			//自行游
			$this -> assign("search",readpicbase("pic_base","catid=14","picid","desc",4));
			//热门推荐
			$this -> assign("sea",readpicbase("pic_base","catid=26","picid","desc",8));
			//轮播
			$this -> assign("re",lunbo(2));
			//轮播左侧小导航；
			$dbb = M("category");
			$red = $dbb -> field("catname") -> where("inid=1") -> all();
			$this -> assign("red",$red);
			$this->display();
		}
	//周边游
		function near(){
			//轮播
			$this -> assign("re",lunbo(3));
			//轮播左侧；
			$db = M("category");
			$res = $db -> where("inid=2") -> all();
			$this -> assign("res",$res);
			//热门推荐
			$dbd = M("pic_base");
			$red = $dbd ->field("title") -> where("ishotgroom=1")->all();
			$this -> assign("red",$red);
			//温泉一天游；
			$this -> assign("result",readtable1(16,4));
			//温泉二天游；
			$this -> assign("row",readtable1(17,4));
			//广深珠旅游；
			$this -> assign("rows",readtable1(18,4));
			//生态游；
			$this -> assign("rowd",readtable1(19,4));
			//肇庆旅游；
			$this -> assign("row1",readtable1(20,4));
			//韶关旅游；
			$this -> assign("row2",readtable1(21,4));
			//跨省旅游；
			$this -> assign("row3",readtable1(22,4));
			//团购旅游；
			$this -> assign("row4",readtable1(23,4));
			//长隆旅游
			$this -> assign("row5",readtable1(24,4));
			$this->display();
		}

		function subject(){
			$big = readpicbase("subjectpic","isbig=1","zid","desc",3);
			$small = readpicbase("subjectpic","isbig=0","zid","desc",27);
			$this->assign("big",$big);
			$this->assign("small",$small);
			$this->display();
		}

		function show_page(){
			$id = $_GET["picid"]; //得到ID;需要连接出团人数表，线路详情表，景点介绍表；
			$db = M("pic_base");
			$pic = $db -> field("title,thumb") -> find("picid=$id"); //得到图片的标题及图片位置；
			$dbs = M("out_num");
			$outnum = $dbs -> all("picid=$id");  //得到出团人数表；


			$this -> assign("pic",$pic);
			$this -> assign("outnum",$outnum);
			$this -> display();
		}
		
	}
?>